package com.cskaoyan.controller.wx;

import com.cskaoyan.model.admin.vo.BaseRespVo;
import com.cskaoyan.model.vx.vo.WxCatalogCurrentRespVO;
import com.cskaoyan.model.vx.vo.WxCatalogRespVO;
import com.cskaoyan.service.wx.WxCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: WxCatalogController
 * @Author: WangEnzhao
 * @Description: 微信商品分类
 * @CreateTime: 2021/12/19:30:00
 */
@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    WxCatalogService wxCatalogService;

    /***
    * @Author: WangEnzhao
    * @Description: 商品分类
    * @CreateTime: 19:59 12/2/2021
    * @Param: []
    * @return: com.cskaoyan.model.admin.vo.BaseRespVo
    */
    @RequestMapping("index")
    public BaseRespVo catalogIndex(){
        WxCatalogRespVO wxCatalogRespVO = wxCatalogService.categoryIndex();
        return BaseRespVo.ok(wxCatalogRespVO);
    }


    @RequestMapping("current")
    public BaseRespVo catalogCurrent(Integer id){
        WxCatalogCurrentRespVO wxCatalogCurrentRespVO = wxCatalogService.categoryCurrent(id);
        return BaseRespVo.ok(wxCatalogCurrentRespVO);
    }
}
